import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
const store = new Vuex.Store({
	state: {
		'topList' : [],
		"nextId" : ''
	},
	mutations:{
		INIT_TOPLISTIDS(state ,payload){
			state.topList = payload
		},
		NEXT_ID(state, payload){
			for(var i=0;i<state.topList.length;i++){
				if(state.topList[i].id == payload){
					state.nextId = state.topList[i+1].id
				}
			}
		}
	}
})
export default store